#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
 struct TreeNode {
     int val;
    struct TreeNode *left;
     struct TreeNode *right;
 };

void Swap(struct TreeNode* root) {
    struct TreeNode* tmp = root->left;
    root->left = root->right;
    root->right = tmp;
}
void TurnTree(struct TreeNode* root)
{
    if (root == NULL) {
        return;
    }
    Swap(root);
    TurnTree(root->left);
    TurnTree(root->right);
}
struct TreeNode* mirrorTree(struct TreeNode* root) {
    TurnTree(root);
    return root;
}
